import type { ManageDataType, GetManageParamsType, DropItemType, AddManageParamsType } from "@/types/rodManage";
import { myGet, myPost, myRequest } from "@/utils/reuqest";

// 获取一体杆数据
export const getManageDataAPI = (params: GetManageParamsType) => {
    return myGet<ManageDataType>('/pole/info/list', params)
}

// 获取关联区域下拉列表
export const getDropListAPI = () => {
    return myGet<DropItemType[]>('/parking/area/dropList')
}

// 新增一体杆
export const addManageAPI = (data: AddManageParamsType) => {
    return myPost('/pole/info', data)
}

// 编辑一体杆
export const editManageAPI = (data: AddManageParamsType & { id: number}) => {
    return myRequest({
        url: '/pole/info',
        method: 'PUT',
        data
    })
}

// 删除一体杆
export const deleteManageAPI = (ids: number[]) => {
    return myRequest({
        url: `/pole/info/${ids.join(',')}`,
        method: 'DELETE'
    })
}
